<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1">
    <title>活动申请</title>
    <link rel="stylesheet" href="../../front/css/common.css">
    <script type="text/javascript" src="../../front/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../front/js/common.js"></script>
</head>
<body>
<div class="ly_header header2">活动申请
    <div class="ly_left goback"><img src="../../front/image/gobackbai.png" alt=""></div>
</div>
<form id="submitform" th:action="@{addActivity.action}" method="post" autocomplete="off">
<div class="releaselist">
    <div class="dw" style="padding: 15px;">
        <div class="informationname color9" style="left: 15px;top: 20px;">
            <img class="imgmindw activityimg" src="../../front/newimg/activityleft1.png"  alt="">活动名称
        </div>
        <input class="informationinput" name="activityName" type="text">
    </div>
</div>
<div class="mart5" style="padding-top: 15px;background: white;">
    <div class="information dw">
        <div class="informationname color9" style="left: 15px;">
            <img class="imgmindw padr5" src="../../front/newimg/hdrenshu.png" style="height: 17px;top: 2px;" alt="">活动最大人数
        </div>
        <input class="informationinput" name="activityMaxNum" value="" style="margin-bottom: 15px;padding-right: 15px" type="text">
    </div>
    <div class="information dw">
        <div class="informationname color9" style="left: 15px;">
            <img class="imgmindw padr5" src="../../front/newimg/hdjifen.png" style="height: 17px;top: 2px;" alt="">收取积分
        </div>
        <input class="informationinput udinput" name="activityIntegral" value="" type="text">
        <span class="dw_r color9 radio udselect" radioshow=".integral" style=""><img src="../../front/newimg/hdjfxz.png" style="height: 14px;" alt=""></span>
    </div>
    <div class="information dw">
        <div class="informationname" style="left: 15px;">
            <img class="imgmindw padr5" src="../../front/newimg/hdyaoqiu.png" style="height: 17px;top: 2px;" alt="">活动对象及要求
        </div>
        <textarea maxlength="200" style="margin-top: 40px;" class="inputtext" name="remark"></textarea>
        <div class="text_right padr20 color6" style="font-size: 0.8em;"><span class="textnum">0</span>/200</div>
    </div>
    <div style="padding: 0 15px;line-height: 2;padding-bottom: 20px;">
        <div style="">
            <img class="imgmindw activityimg" src="../../front/newimg/activityleft1.png" alt="">上传照片
        </div>
        <div class="dw">
            <img src="../../front/newimg/hdimg.png" style="height:92px" alt="">
            <input type="file" name="" style="width:92px;height: 92px;" class="dw_l uploadimg">
        </div>
        <div class="color9" style="font-size: 0.8em;">只支持png/jpg格式</div>
    </div>
</div>
</form>
<div class="bottombtn">
    <img src="../../front/newimg/hdsqbtn.png" class="addactivitybtn" style="height: 49px;width: 100%;" alt="">
</div>
<div id="mask" class="hide" style="z-index: 8"></div>
<div class="hide integral drop-down" style="z-index: 8">
    <div class="ly_header">积分
        <div class="ly_left radiono" radioval="activityIntegral"><img src="../../front/image/no.png" alt=""></div>
        <div class="ly_right radioyes" radioval="activityIntegral"><img src="../../front/image/yes.png" alt=""></div></div>
    <div class="insteadOf"></div>
    <ul class="selectlist radiolist">
        <li>5</li>
        <li>4</li>
        <li>3</li>
        <li>2</li>
        <li>1</li>
        <li>0</li>
    </ul>
</div>
</body>
<script type="text/javascript" src="../../front/js/information.js"></script>
<script>
    $('textarea').bind('input propertychange', function(){
        var l=$(this).val().length;
        $(".textnum").text(l)
    });
    $(document).on("change",".uploadimg",function(){
        var that=$(this);
        var formdata=new FormData();
        var val=$(this)[0].files[0];
        formdata.append("file",val);
        $.ajax({
            type: "post",
            url: ctxPath+"../../common/uploadMemberImage.action",
            data: formdata,
            dataType: "json",
            processData : false,
            contentType : false,
            cache: false,
            success: function(data){
                console.log(data);
                $(that).siblings("img").attr("src","../../"+data.result.url);
            }
        });
    })
    $(document).on("click",".addactivitybtn",function(){
        $('#submitform').submit()

    })
</script>
</html>